package com.bluefish.bltuan.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.bluefish.bltuan.dao.TicketDao;
import com.bluefish.bltuan.module.shop.Ticket;
import com.bluefish.bltuan.module.user.User;
import com.bluefish.bltuan.service.TicketService;
import com.bluefish.bltuan.util.PageIndex;

@Service
@Transactional
public class TicketServiceImpl implements TicketService {

	private TicketDao ticketDao;
	
	public void setTicketDao(TicketDao ticketDao) {
		this.ticketDao = ticketDao;
	}

	public void save(Ticket t) {
		this.ticketDao.save(t);
	}

	public void update(Ticket t) {
		this.ticketDao.update(t);
	}

	public void delete(Ticket t) {
		this.ticketDao.delete(t);
	}

	public Ticket findById(Integer id) {
		return this.ticketDao.findById(id);
	}

	public List<Ticket> listByUser(User user, PageIndex pageIndex) {
		return this.ticketDao.listByUser(user, pageIndex);
	}

}
